#include <iostream>
#include "cash.h"
#include "cashfactory.h"

CashFactory::CashFactory()
{
    std::cout << "CashFactory" << std::endl;
}

CashFactory::~CashFactory()
{
    std::cout << "~CashFactory" << std::endl;
}

CashSuper *CashFactory::CreateCash(int type)
{
    CashSuper *cash = NULL;
    switch (type)
    {
        case CASH_NORMAL:
            cash = new CashNormal;
            break;
        case CASH_REBATE:
            cash = new CashRebate;
            break;
        case CASH_RETURN:
            cash = new CashReturn;
            break;
        default:
            break;
    }

    return cash;
}




